int findMaxConsecutiveOnes(vector<int> &nums)
{
    int mid = 0, max = mid;
    for (int i = 0; i < nums.size(); i++)
    {
        if (nums[i] == 1)
        {
            mid++;
        }
        if (nums[i] == 0 || i == nums.size() - 1)
        {
            max = max < mid ? mid : max;
            mid = 0;
        }
    }
    return max;
}